
public class Customer {
	
	private String firstName;
	private String lastName;
	private String creditCard;
	private String address;
	
	private long customerID;
	
	private boolean idSet = false;
	
	public Customer(String creditCard) {
		this.creditCard = creditCard;
	}
	
	public Customer(String creditCard, String firstName, String lastName, String address) {
		this(creditCard);
		this.firstName = firstName;
		this.lastName = lastName;
		this.address = address;
	}
	
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getFirstName() {
		return firstName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public String getLastName() {
		return lastName;
	}

	public void setCreditCard(String creditCard) {
		this.creditCard = creditCard;
	}

	public String getCreditCard() {
		return creditCard;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getAddress() {
		return address;
	}

	public void setCustomerID(long customerID) {
		this.customerID = customerID;
		idSet = true;
	}

	public long getCustomerID() {
		return customerID;
	}

	public boolean isIdSet() {
		return idSet;
	}
	
	@Override
	public boolean equals(Object cus) {
		if (cus instanceof Customer) {
			Customer cusOther = (Customer) cus;
			return cusOther.creditCard.equals(creditCard);
		}
		return false;
	}

    @Override
    public int hashCode() {
        return creditCard.hashCode();
    }

}

